/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package wrap.core;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author liang
 */
public class PageContainer{
        private Class _class = null;

        public PageContainer(String classname){
            try {
                System.out.println("new PageContainer + " + classname);
                java.lang.Class c = java.lang.Class.forName(classname);
                _class = c;
                System.out.println("new PageContainer class forName OK: " + getName());
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(CC.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

        public Class getClassRef(){return _class;}
        public String getName(){return _class.getSimpleName();}
        public Object newInstance(){
            try {
                return _class.newInstance();
            } catch (InstantiationException ex) {
                Logger.getLogger(CC.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                Logger.getLogger(CC.class.getName()).log(Level.SEVERE, null, ex);
            }
            return null;
        }
    }
